package yagwl.service.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

public class DateTimeUtil {

  //private static TimeZone userTZ = TimeZone.getTimeZone(ConfigService
  //    .getUserTimeZoneId());
  //private static TimeZone serverTZ = TimeZone.getTimeZone(ConfigService
  //    .getServerTimeZoneId());
  private static DateFormat df = DateFormat.getDateTimeInstance(
      DateFormat.SHORT, DateFormat.SHORT, new Locale("en", "IN"));

  public static String getDateTimeString(Date date) {
    if (date == null)
      return null;
    //df.setTimeZone(userTZ);
    return df.format(date);
  }

  public static Date getDate(String dateStr) throws ParseException {
    Date date = df.parse(dateStr);
    return date;
  }

  public static void convertUserTimeToServerTime(Calendar cal) {
    //cal.add(Calendar.MILLISECOND, -userTZ.getRawOffset()
    //    + serverTZ.getRawOffset());
  }

}
